<div class="tabbable tabs-left">
              <ul class="nav nav-tabs">
              	<li><h5><?php echo $this->translate('友情链接'); ?></h5></li>
                <li class="active"><a data-toggle="tab" href="#express_a"><?php echo $this->translate('基本信息'); ?></a></li>
              </ul>
              <form class="form-horizontal" name="links_form" id="links_form" method="post" enctype="multipart/form-data" action="">
              <input type="hidden" name="links_id" id="links_id" value="<?php if($this->links_info) echo $this->links_info->links_id; else echo ''; ?>" />
              <div class="tab-content">
    			<div id="sticky_navigation" style="height:30px;border-bottom:4px solid #DFDFDF;">
        			<div class="pull-left" style="font-size:16px;line-height:30px;"><strong><?php if($this->links_info) echo $this->translate('编辑'); else echo $this->translate('新加'); ?><?php echo $this->translate('友情链接'); ?></strong></div>
        			<div class="pull-right">
                	<a href="<?php echo $this->url('links/default'); ?>" class="btn btn-small"><i class="icon-arrow-left"></i> <?php echo $this->translate('返回友情链接列表'); ?></a>&nbsp;
                	<a href="<?php echo $this->serverUrl(true); ?>" class="btn btn-small btn-warning"><i class="icon-repeat icon-white"></i> <?php echo $this->translate('刷新'); ?></a>&nbsp;
                    <?php if($this->links_info) { ?>
                    <a href="javascript:;" onclick="return links_del_js(<?php echo $this->links_info->links_id ?>);" class="btn btn-small btn-danger"><i class="icon-remove icon-white"></i> <?php echo $this->translate('删除友情链接'); ?></a>&nbsp;
                    <?php } ?>
                	<button type="submit" class="btn btn-small btn-primary"><i class="icon-ok icon-white"></i> <?php echo $this->translate('保存友情链接信息'); ?></button>&nbsp;
                	<a href="<?php echo $this->myviewalias()->dbshopHelpUrl('link_set'); ?>" target="_blank" class="btn btn-small btn-info"><i class="icon-info-sign icon-white"></i> <?php echo $this->translate('查看帮助说明'); ?></a>
                	</div>
        		</div>
                <div id="express_a" class="tab-pane active">
                	<div class="well admin_add_header_well"><?php echo $this->translate('基本信息'); ?></div>
                	<div class="well admin_add_well"> 
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('网站名称'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<input type="text" id="links_webname"  name="links_webname" class="span8" value="<?php echo ($this->links_info ? $this->escapeHtml($this->links_info->links_webname) : ''); ?>">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('网站地址'); ?>：</label>
           					<div class="controls">
              					<input type="text" id="links_url"  name="links_url" class="span8" value="<?php echo ($this->links_info ? $this->links_info->links_url : ''); ?>">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('网站logo'); ?>：</label>
           					<div class="controls">
              					<?php if($this->links_info and $this->links_info->links_logo) { ?>
              					<p id="old_brand_logo_show">
                                <img src="<?php echo $this->basePath($this->links_info->links_logo); ?>" style="height:30px;" border="0">
              					</p>
              					<input type="hidden" name="old_links_logo" value="<?php echo $this->links_info->links_logo; ?>">
              					<?php } ?>
              					<input type="file" name="links_logo" />
            				</div>                        
                        </div> 
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('排序'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<input type="text" class="span1" name="links_sort" id="links_sort" value="<?php echo ($this->links_info ? $this->links_info->links_sort : 255); ?>" />
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('状态'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<label class="radio inline"><input type="radio" value="1" <?php if(($this->links_info and $this->links_info->links_state == 1) or !$this->links_info) echo 'checked="checked"'; ?> name="links_state"><?php echo $this->translate('启用'); ?></label>
                                <label class="radio inline"><input type="radio" value="0" <?php if($this->links_info and $this->links_info->links_state == 0) echo 'checked="checked"'; ?> name="links_state"><?php echo $this->translate('禁用'); ?></label> 
            				</div>                        
                        </div>                                                                                                                                               
                  	</div>
                </div>
                                
                
             </div>
              </form>
</div>
<script>
$(document).ready(function() {
	$("#links_form").validate({
		rules: {
			links_webname: {
				required: true,
				maxlength:30
			},
			links_url: {
				url: true
			},
			links_sort: {
				required: true,
				number: true,
				min:1,
				max:255
			}
		},
		messages: {
			links_webname: {
				required: "<?php echo $this->translate('友情链接名称不能为空！'); ?>",
				maxlength: "<?php echo $this->translate('友情链接名称最多输入30个汉字！'); ?>"
			},
			links_url: {
				url: "<?php echo $this->translate('请填写正确的url地址！如 http://www.dbshop.net/ 必须是http://或者https://开头'); ?>"
			},
			links_sort: {
				required: "<?php echo $this->translate('友情链接排序不能为空！'); ?>",
				number: "<?php echo $this->translate('友情链接排序必须为数字！'); ?>",
				min: "<?php echo $this->translate('友情链接排序最小为1！'); ?>",
				max: "<?php echo $this->translate('友情链接排序最大为255！'); ?>"
			}
		}
	});
});

//友情链接删除js
function links_del_js(links_id) {
	if(window.confirm('<?php echo $this->translate('您确实要删除该友情链接吗？'); ?>')) {
	$.post("<?php echo $this->url('links/default',array('action'=>'del')); ?>",{links_id:links_id},
	function(data){
		if(data != 'false') {
			window.location.href='<?php echo $this->url('links/default'); ?>';
			return true;
		} else {
			alert('<?php echo $this->translate('友情链接删除失败！'); ?>');
		}
	});
	}
	return false;
}
</script>